<%--
  Created by IntelliJ IDEA.
  User: 12135
  Date: 2022/12/23
  Time: 23:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en"><!-- Basic -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <!-- Mobile Metas -->
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <!-- Site Metas -->
    <title>登录和注册</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Site Icons -->
    <link rel="shortcut icon" href="LoginWeb/images/logo(1).ico" type="image/x-icon">
    <link rel="logo(1)" href="LoginWeb/images/logo(1).ico">

    <!-- Bootstrap CSS -->
    <link href="LoginWeb/css/bootstrap.min.css" rel="stylesheet">
    <!-- Site CSS -->
    <link rel="stylesheet" href="LoginWeb/css/style.css">
    <!-- Fontawesome CSS -->
    <link rel="stylesheet" href="LoginWeb/css/all.min.css">
    <!-- Responsive CSS -->
    <link rel="stylesheet" href="LoginWeb/css/responsive.css">
    <!-- Custom CSS -->
    <link rel="stylesheet" href="css/custom.css">

    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>
<div id="particles-js" class="main-form-box">
    <div class="md-form">
        <div class="container">
            <div class="row">
                <div class="col-md-6 offset-md-3">
                    <div class="panel panel-login">
                        <div class="logo-top">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="#"><img src="LoginWeb/images/logo(2).png" alt="" /></a>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="Index?type=getlist1">&times;</a>
                        </div>
                        <div class="panel-heading">
                            <div class="row">
                                <div class="col-lg-6 col-sm-6 col-xl-6">
                                    <a href="#" class="active" id="login-form-link">登录</a>
                                </div>
                                <div class="col-lg-6 col-sm-6 col-xl-6">
                                    <a href="#" id="register-form-link">注册</a>
                                </div>
                                <div class="or">OR</div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-12">
                                    <form id="login-form" action="LoginServlet?type=login" method="post" role="form" style="display: block;">
                                        <div class="form-group">
                                            <label class="icon-lp"><i class="fas fa-user-tie"></i></label>
                                            <input type="text" name="username" id="username" tabindex="1" class="form-control" placeholder="账号" value="" required="">
                                        </div>
                                        <div class="form-group">
                                            <label class="icon-lp"><i class="fas fa-key"></i></label>
                                            <input type="password" name="userpwd" id="userpwd" tabindex="2" class="form-control" placeholder="密码" required="">
                                        </div>

                                        <div class="form-group">
                                            <div class="row">
                                                <div class="col-sm-6 offset-sm-3">
                                                    <input type="submit" name="login-submit" id="login-submit" tabindex="4" class="form-control btn btn-login" value="登录">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="row">
                                                <div class="col-lg-12">
                                                    <div class="text-center">
                                                        <a href="#" tabindex="5" class="forgot-password">忘记密码?</a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                    <form id="register-form" action="RegisterServlet" method="post" role="form" style="display: none;">
                                        <div class="form-group">
                                            <label class="icon-lp"><i class="fas fa-user-tie"></i></label>
                                            <input type="text" name="username" id="username1" tabindex="1" class="form-control" placeholder="账号" value="" required="">
                                        </div>
                                        <div class="form-group">
                                            <label class="icon-lp"><i class="fas fa-key"></i></label>
                                            <input type="password" name="password" id="password" tabindex="2" class="form-control" placeholder="密码" required="">
                                        </div>
                                        <div class="form-group">
                                            <label class="icon-lp"><i class="fas fa-key"></i></label>
                                            <input type="password" name="confirm-password" id="confirm-password" tabindex="2" class="form-control" placeholder="确认密码" required="">
                                        </div>
                                        <div class="che-box">
                                            <label class="checkbox-in">
                                                <input name="checkbox" type="checkbox"> <span></span>已同意 <a href="#"> 《用户协议》 </a> 和 <a href="#">《隐私协议》 </a>
                                            </label>
                                        </div>

                                        <div class="form-group">
                                            <div class="row">
                                                <div class="col-sm-6 offset-sm-3">
                                                    <input type="submit" name="register-submit" id="register-submit" tabindex="4" class="form-control btn btn-register" value="立即注册">
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>

                    <p class="footer-company-name">All Rights Reserved. &copy; 2022 <a href="login.jsp">Login Register</a> Design By : <a href="login.jsp">blog design</a></p>

                </div>
            </div>
        </div>
    </div>

</div>


<script src="LoginWeb/js/jquery.min.js"></script>
<script src="LoginWeb/js/bootstrap.min.js"></script>
<script src="LoginWeb/js/particles.min.js"></script>
<script src="LoginWeb/js/index.js"></script>
<script type="text/javascript">
    $(function() {
        $('#login-form-link').click(function(e) {
            $("#login-form").delay(100).fadeIn(100);
            $("#register-form").fadeOut(100);
            $('#register-form-link').removeClass('active');
            $(this).addClass('active');
            e.preventDefault();
        });
        $('#register-form-link').click(function(e) {
            $("#register-form").delay(100).fadeIn(100);
            $("#login-form").fadeOut(100);
            $('#login-form-link').removeClass('active');
            $(this).addClass('active');
            e.preventDefault();
        });
    });

    $('.form-group input').focus(function () {
        $(this).parent().addClass('addcolor');
    }).blur(function () {
        $(this).parent().removeClass('addcolor');
    });

</script>
<script type="text/javascript">
    //登录
    $("#login-submit").click(function(){
        var user=$("#username").val();//根据控件id获得值
        var pwd=$("#userpwd").val();//根据控件id获得值
        //var yzm=$("#code").val();//根据控件id获得值
        if(user.length<1)
        {
            alert("账号不能为空！");
            $("#username").focus();//根据控件id获得焦点
            return;
        }
        if(pwd.length<1)
        {
            alert("密码不能为空！");
            $("#userpwd").focus();
            return;
        }
        else{
            $("#login-form").submit();//根据表单id提交表单
        }
    });
</script>
</body>
</html>


